import {createStore, combineReducers, compose, applyMiddleware} from "redux";
import product from "./product";
import cart from "./cart";
import thunk from 'redux-thunk'

const rootRenderer = combineReducers({
  product,
  cart
})

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
  rootRenderer,
  composeEnhancers(applyMiddleware(thunk))//使用浏览调试,并且使用thunk异步中间件
  );

export default store